package cn.admin.system.staff.infrastructure.repository.repository.impl;

import cn.admin.system.staff.infrastructure.repository.entity.SysUser;
import cn.admin.system.staff.infrastructure.repository.mapper.SysUserMapper;
import cn.admin.system.staff.infrastructure.repository.repository.SysUserRepository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author YJ
 * @DateTime 2023/2/22 10:35
 */
@Service
public class SysUserRepositoryImpl implements SysUserRepository {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser selectSysUserByUserName(String userName) {
        return sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda()
                .eq(SysUser::getUserName,userName));
    }
}
